package com.baiwei.vpnapi.entity;

import com.baiwei.vpnapi.config.i18n.IntternationalConfig;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.Date;

/**
 * @program: vpnapi
 * @description: vpn服务器
 * @author: Mr. Stone
 * @create: 2020-02-27 11:03
 **/
@TableName("vpnserver")
@Data
public class VpnServer {
    @TableId(value = "server_id", type = IdType.AUTO)
    private Integer serverId;
    private String serverIp;
    private String serverPort;
    private String serverName;
    private String pubKey;
    //private Integer isFree;
    private Integer serverType;
    private String icon;
    @JsonIgnore
    private Integer status;
    @JsonIgnore
    private Date createTime;
    @JsonIgnore
    private Date updateTime;
    @JsonIgnore
    private String englishName;
    @JsonIgnore
    private Integer areaLevel;
    @JsonIgnore
    private String twName;

    public Integer getIsFree() {
        return serverType == 1? 1: 0;
    }

    public Integer getIsExclusive() {
        return serverType == 2? 1: 0;
    }
}
